# encoding: utf-8
# @File  : 01赋值运算符.py
# @Author: Morpheus
# @Date  : 2025/10/24/11:23


# 作用 : 将计算结果重新赋值给已有的变量名, 赋值运算符是先计算再赋值
# 应用场景：累计求和/差/积等场景使用
a=10
b=20

a += b
# 相当于 a = a + b
print("a =", a)
# 此时：a = 30
a -= b
# 相当于 a = a ‐ b
print("a =", a)
# 此时：a = 10
a *= b
# 相当于 a = a * b
print("a =", a)
# 此时：a = 200
a /= b
# 相当于 a = a / b
print("a =", a)
# 此时：a = 10.0
a %= b
# 相当于 a = a % b
print("a =", a)
# 此时：a = 1